package com.storeapp.entity.domain;

import java.util.Collection;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;

@Entity
@Table(name = "store_customer")
public class MyCustomer{

	private Long id;	
	private String customerName;
	private Date birthdat;
	private String phone;
	private String gender;
	private String email;
	
	private Collection<DealOrder> dealOrders;
	
	public MyCustomer() {}
	
	public MyCustomer(String customerName, Date birthdat, String phone, String gender, String email) {
		super();
		this.customerName = customerName;
		this.birthdat = birthdat;
		this.phone = phone;
		this.gender = gender;
		this.email = email;
	}
	
	@OneToMany(mappedBy="myCustomer")
	public Collection<DealOrder> getDealOrders() {
		return dealOrders;
	}

	public void setDealOrders(Collection<DealOrder> dealOrders) {
		this.dealOrders = dealOrders;
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(nullable = false)
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public Date getBirthdat() {
		return birthdat;
	}
	public void setBirthdat(Date birthdat) {
		this.birthdat = birthdat;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
}
